﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AjConsor.Entities;
using NHibernate;

namespace AjConsor.WebNh1
{
    public partial class ConsorcioList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                //var session = Global.SessionFactory.OpenSession();                
                // ISession session = (ISession)Context.Items["NhSession"];

                ISession session = Global.SessionFactory.GetCurrentSession();
                this.GridView1.DataSource = session.CreateCriteria<Consorcio>().List();
                this.GridView1.DataBind();
                //session.Close();
            }
        }
    }
}
